package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.CustomerRechargeRecordMapper;
import com.ruoyi.hospital.domain.CustomerRechargeRecord;
import com.ruoyi.hospital.service.ICustomerRechargeRecordService;

/**
 * 客户充值记录Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-04
 */
@Service
public class CustomerRechargeRecordServiceImpl implements ICustomerRechargeRecordService 
{
    @Autowired
    private CustomerRechargeRecordMapper customerRechargeRecordMapper;

    /**
     * 查询客户充值记录
     * 
     * @param id 客户充值记录主键
     * @return 客户充值记录
     */
    @Override
    public CustomerRechargeRecord selectCustomerRechargeRecordById(Long id)
    {
        return customerRechargeRecordMapper.selectCustomerRechargeRecordById(id);
    }

    /**
     * 查询客户充值记录列表
     * 
     * @param customerRechargeRecord 客户充值记录
     * @return 客户充值记录
     */
    @Override
    public List<CustomerRechargeRecord> selectCustomerRechargeRecordList(CustomerRechargeRecord customerRechargeRecord)
    {
        return customerRechargeRecordMapper.selectCustomerRechargeRecordList(customerRechargeRecord);
    }

    /**
     * 新增客户充值记录
     * 
     * @param customerRechargeRecord 客户充值记录
     * @return 结果
     */
    @Override
    public int insertCustomerRechargeRecord(CustomerRechargeRecord customerRechargeRecord)
    {
        customerRechargeRecord.setCreateTime(DateUtils.getNowDate());
        return customerRechargeRecordMapper.insertCustomerRechargeRecord(customerRechargeRecord);
    }

    /**
     * 修改客户充值记录
     * 
     * @param customerRechargeRecord 客户充值记录
     * @return 结果
     */
    @Override
    public int updateCustomerRechargeRecord(CustomerRechargeRecord customerRechargeRecord)
    {
        customerRechargeRecord.setUpdateTime(DateUtils.getNowDate());
        return customerRechargeRecordMapper.updateCustomerRechargeRecord(customerRechargeRecord);
    }

    /**
     * 批量删除客户充值记录
     * 
     * @param ids 需要删除的客户充值记录主键
     * @return 结果
     */
    @Override
    public int deleteCustomerRechargeRecordByIds(Long[] ids)
    {
        return customerRechargeRecordMapper.deleteCustomerRechargeRecordByIds(ids);
    }

    /**
     * 删除客户充值记录信息
     * 
     * @param id 客户充值记录主键
     * @return 结果
     */
    @Override
    public int deleteCustomerRechargeRecordById(Long id)
    {
        return customerRechargeRecordMapper.deleteCustomerRechargeRecordById(id);
    }
}
